import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/ControlPanel'
  },
  {
    path: '/',
    component: ()=>import("@/views/Menu"),
    meta: {title: '主菜单'},
    children: [
      {
        path: '/ControlPanel',
        component: ()=>import("@/views/system/ControlPanel"),
        meta: {title: '控制面板'}
      },
      {
        path: '/FileController',
        component: ()=>import("@/views/system/FileController"),
        meta: {title: '文件管理'}
      },
      {
        path: '/UserManger',
        component: ()=>import("@/views/system/wgs/UserManger"),
        meta: {title: '用户管理'}
      },
      {
        path: '/DepartmentManger',
        component: ()=>import("@/views/system/zyt/DepartmentManger"),
        meta: {title: '部门管理'}
      },
      {
        path: '/RoleManger',
        component: ()=>import("@/views/system/zyt/RoleManger"),
        meta: {title: '角色管理'}
      },
      {
        path: '/AuthorityManger',
        component: ()=>import("@/views/system/wgs/AuthorityManger"),
        meta: {title: '权限管理'}
      },
      {
        path: '/IconManager',
        component: ()=>import("@/views/system/IocnManger"),
        meta: {title: '图标管理'}
      },
      {
        path: '/ProductGo',
        component: ()=>import("@/views/business/syl/ProductGo"),
        meta: {title: '物资去处'}
      },
      {
        path: '/ProductRecord',
        component: ()=>import("@/views/business/zj/ProductRecord"),
        meta: {title: '入库记录'}
      },
      {
        path: '/ProductInfo',
        component: ()=>import("@/views/business/syl/ProductInfo"),
        meta: {title: '物资资料'}
      },
      {
        path: '/ProductCategory',
        component: ()=>import("@/views/business/zj/ProductCategory"),
        meta: {title: '物资类别'}
      },
      {
        path: '/Productource',
        component: ()=>import("@/views/business/syl/Productource"),
        meta: {title: '物资来源'}
      },
      {
        path: '/ReleaseRecord',
        component: ()=>import("@/views/business/zj/ReleaseRecord"),
        meta: {title: '发放记录'}
      },
      {
        path: '/ProductStock',
        component: ()=>import("@/views/business/zj/ProductStock"),
        meta: {title: '物资库存'}
      },
      {
        path: '/page2',
        component: ()=>import("@/views/page2"),
        meta: {title: '页面二'}
      },
      {
        path: '/page3',
        component: ()=>import("@/views/pageThree"),
        meta: {title: '页面三'}
      },
      {
        path: '/404',
        component: ()=>import("@/views/404"),
        meta: {title: '404 Not Found'}
      },
      {
        path: '/403',
        component: ()=>import("@/views/403"),
        meta: {title: '403 Access Rejected'}
      },
    ]
  },
  {
    path: '/login',
    component: ()=>import("@/views/Login")
  },
  {
    path: '*',
    redirect: '/404'
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
